﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Globalization;
using System.Threading;

namespace BulldogCMS.Core.Runtime
{
    public class LanguageSelector : IDisposable
    {
        private CultureInfo _previousCulture = null;

        public LanguageSelector(string langName)
        {
            this._previousCulture = Thread.CurrentThread.CurrentCulture;
            Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo(langName);
        }

        public void Dispose()
        {
            Thread.CurrentThread.CurrentCulture = _previousCulture;
        }
    }
}